<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>支付宝支付案例</title>
</head>

<style>
    .main{
        width: 600px;
        height: 350px;
        border: solid 2px black;
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -175px;
        margin-left: -300px;
        padding: 20px;
        float: left;
    }
    .title{
        width: 100%;
        font-size: 20px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
    }
    .row{
        width: 51%;
        margin-top: 20px;
        float: left;
        margin-left: 20%;
    }
    .row input{
        width: 70%;
        height: 30px;
        float: left;
        display: block;
        box-sizing: border-box;
    }
    .row label{
        width: 30%;
        display: block;
        float: left;
    }
    .row button{
        float: left;
        height: 30px;
    }
    .row .left{
        width: 20%;
        margin: 0 4% 0 30%;

    }
    .row .right{
        width: 46%;
    }

</style>
<script>

    window.onload=function(){
        randomShopId(); //随机产生商品Id
    }

    function randomShopId(){
        var shopId="cya_"+new Date().getTime();
        var shop=document.getElementById('shop-id');
        shop.value=shopId
    }
    function reload(){
        location.reload()
    }
</script>
<body>
<div class="main">
    <div class="title">支付宝 网站支付案例</div>
    <form method="post" action="/alpay/pay">
        <div class="row">
            <label>订单ID：</label>
            <input readonly="readonly" name="orderId" value="${orderForm.order_code}" id="shop-id"/>
        </div>
        <div class="row">
            <label>商品名称：</label>
            <input name="shopName" value="${orderForm.subject}" placeholder="请输入商品名称" />
        </div>
        <div class="row">
            <label>商品价格：</label>
            <input name="shopPrice" value="${orderForm.total_amount}" placeholder="请输入商品价格" />
        </div>
        <div class="row">
            <label>商品描述：</label>
            <input name="orderDesc" value="${orderForm.body}" placeholder="请输入商品描述" />
        </div>
        <div class="row">
            <button class="right" type="submit">去购买</button>
        </div>

    </form>
    <div style="width:100%;margin-left: 20%;padding:20px 0;float:left;"><a style="display:block;float:left;" href="getOrderforms">查看所有订单信息</a></div>
</div>
</body>
</html>


